﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Text;
using RAP.Framework.Libary.DataSource.Model;
using RAP.Framework.Libary.Utils;

namespace RAP.Framework.Libary.DataSource.DataReader
{
    /// <summary>
    /// 动态键值对解析器
    /// </summary>
    public class DynamicParser : DictionaryParser
    {
		/// <summary>
		/// 
		/// </summary>
		/// <param name="resultTypeName"></param>
		/// <param name="properites"></param>
		/// <returns></returns>
		public override object CreateDataModel( string resultTypeName = null, IDictionary properites = null )
		{
			var data = new DynamicHashtable();
			if ( properites.IsNotNullOrEmpty() )
			{
				properites.CopyTo( data );
			}
			return data;
		}
	}
}
